home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_boulderfog.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  115 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_BoulderFog.cog
  4. #
  5. # [MDR] && [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     user0
  13.     message     user1
  14.     message     entered
  15.     message     pulse
  16.     
  17.     thing       player          local
  18.     thing       fogGhost
  19.     
  20.     sector      boulderRoom
  21.     sector      lavaRoom
  22.                        
  23.     vector      vec_facing      local
  24.     
  25.     int         inHall=0        local
  26.     
  27. end
  28.  
  29. # ========================================================================================
  30.  
  31. code
  32.  
  33. user0:
  34.  
  35.     # fog override for boulder cutscene
  36.     SetPulse(0.0);
  37.         
  38.     # set fog to red
  39.     SetFog(1, '0.5, 0.05 0.05', 40, 180);
  40.     #SetFog(1, '0.5, 0.05 0.05', 1, 180);
  41.     
  42.     return;
  43.     
  44. # ========================================================================================
  45.  
  46. user1:
  47.  
  48.     # return fog control
  49.     SetPulse(0.5);
  50.     
  51.     # set fog to grey
  52.     #SetFog(1, '0.15 0.15 0.15', 40, 110);
  53.  
  54.     return;
  55.  
  56. # ========================================================================================
  57.  
  58. entered:
  59.  
  60.     player = GetLocalPlayerThing();
  61.     
  62.     if(GetSenderRef() == boulderRoom)
  63.     {
  64.         Print("entered boulderRoom");
  65.         inHall = 1;
  66.         SetPulse(0.5);
  67.     }
  68.     
  69.     if(GetSenderRef() == lavaRoom)
  70.     {
  71.         Print("entered lavaRoom");
  72.         inHall = 0;
  73.         SetPulse(0.0);
  74.         
  75.         # set fog to red
  76.         SetFog(1, '0.5, 0.05 0.05', 15, 180);
  77.     }
  78.         
  79.     return;
  80.         
  81. # ========================================================================================
  82.  
  83. pulse:
  84.  
  85.     vec_facing = VectorSub( GetThingPos(fogGhost), GetThingPos(player));
  86.     vec_facing = VectorNorm(vec_facing);
  87.     
  88.     if(inHall == 1)
  89.     {
  90.         if (VectorDot(GetThingLVec(player), vec_facing) >= 0)
  91.         {
  92.             # Player is facing fogGhost
  93.             # set fog to red
  94.             SetFog(1, '0.5, 0.05 0.05', 40, 180);
  95.             #SetFog(1, '0.5, 0.05 0.05', 1, 180);
  96.         }
  97.         
  98.         else
  99.         {
  100.             # player's back is to fogGhost
  101.             # set fog to grey
  102.             SetFog(1, '0.15 0.15 0.15', 40, 110);
  103.         }
  104.     }
  105.     
  106.     else
  107.         return;
  108.     
  109.     return;
  110.         
  111. # ========================================================================================
  112.  
  113. end
  114.  
  115.